Page({
    data:{
        swiperCurrent: 0,
        referShow: false
    },
    onLoad(options){
        this.setData({
            swiperCurrent: options.swiperCurrent
        })
    },
    handleLeft() {
        let value = this.data.swiperCurrent - 1 
        if(value >= 0) {
            this.setData({
                swiperCurrent: value
            })
        } 
        else {
            this.setData({
                swiperCurrent: 4
            })
        }      
    },
    handleRight() {
        let value = this.data.swiperCurrent + 1
        if(value < 5) {
            this.setData({
                swiperCurrent: value
            })
        }  
        else {
            this.setData({
                swiperCurrent: 0
            })
        }  
    },
    handleReferShow() {
        this.setData({
            referShow: true
        })
    },
    handleReferHidden() {
        this.setData({
            referShow: false
        })
    },
    handleSelect() {
        wx.navigateTo({
          url: '/pages/select/select'
        })
    },
    handleUser() {
        wx.navigateTo({
          url: '/pages/user/user'
        })
    },
    onShareAppMessage() {
        return {
            title: '定制团体服，来找熊猫印！',
            path: '/pages/index/index?swiperCurrent=2'
        }
    }
})